package com.ruoyi.student.service.impl;

import com.ruoyi.student.domain.Student;
import com.ruoyi.student.mapper.StudentMapper;
import com.ruoyi.student.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
    private StudentMapper mapper;
    @Override
    //service是接口板，并没有真的实现方法

    public List<Student> getStudentList() {
        return mapper.queryAll();
    }

    @Override
    public int addStudent(Student student) {
        return mapper.addStudent(student);
    }

    @Override
    public List<Student> queryStudentByName(String sname) {
        return mapper.queryStudentByName(sname);
    }

    @Override
    public void updateStudent(Student student) {
        mapper.updateStudent2(student);
    }

    @Override
    public void deleteStudent(int id) {
        mapper.deleteStudent2(id);

    }
}
